/* 全局样式重置和基础设置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

#root {
  min-height: 100vh;
}

/* 通用按钮样式 */
button {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

button:focus {
  outline: 2px solid rgba(116, 185, 255, 0.5);
  outline-offset: 2px;
}

/* 通用输入框样式 */
input {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
}

input:focus {
  outline: 2px solid rgba(116, 185, 255, 0.5);
  outline-offset: 2px;
}

/* 通用链接样式 */
a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* 通用列表样式 */
ul, ol {
  list-style: none;
}

/* 图片响应式 */
img {
  max-width: 100%;
  height: auto;
}

/* 代码字体 */
code {
  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
    monospace;
}

/* 选择文本样式 */
::selection {
  background: rgba(116, 185, 255, 0.3);
  color: #333;
}

::-moz-selection {
  background: rgba(116, 185, 255, 0.3);
  color: #333;
}

/* 焦点可见性 */
:focus-visible {
  outline: 2px solid #74b9ff;
  outline-offset: 2px;
}

/* 禁用状态 */
:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 工具类 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.hidden {
  display: none;
}

.visible {
  display: block;
}

/* 动画减少偏好 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
  * {
    border-color: currentColor;
  }
}

/* 打印样式 */
@media print {
  * {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  a,
  a:visited {
    text-decoration: underline;
  }
  
  .no-print {
    display: none !important;
  }
}
